﻿using System;
using ML.Entity;
using System.Collections.Generic;

namespace ML.IRepository
{
    public interface IOrderRepository : IBaseRepository<OrderEntity>
    {
        Pager<OrderResponse> List(OrderSearch orderSearch);

        OrderResponse GetDetailById(string id);

        OrderResponse GetInfoById(string id);

        IEnumerable<OrderResponse> GetListByUserId(string id);

        IEnumerable<OrderResponse> GetListByState(string state);

        IEnumerable<OrderEntity> GetOrderInfoByMerchantId(string id);

        IEnumerable<OrderEntity> GetTrueOrderInfoByMerchantId(string merchantId);

        IEnumerable<OrderEntity> GetOrderInfoListDays();

        bool Add(OrderEntity entity, List<OrderDetailsEntity> orderDetails);

        bool UpdateState(string id, int state);

        bool UpdatePayState(string id, int payState);

        int GetPaidOrderByTime(string id, DateTime beginTime, DateTime endTime);

        /// <summary>
        /// 获取指定时间段内未支付的订单信息
        /// </summary>
        /// <param name="beginTime">开始时间</param>
        /// <param name="endTime">截止时间</param>
        /// <returns></returns>
        IEnumerable<OrderEntity> GetOrderUnPay(DateTime beginTime, DateTime endTime);

        /// <summary>
        /// 获取指定商家id时间段内的订单信息
        /// </summary>
        /// <param name="id">商家id</param>
        /// <param name="beginTime">开始时间</param>
        /// <param name="endTime">截止时间</param>
        /// <returns></returns>
        IEnumerable<OrderEntity> GetOrderStatistics(string id, DateTime beginTime, DateTime endTime);

    }
}